package com.cashmama.market.api.application;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySources;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2018/8/15
 * Time: 下午8:03
 */
@ComponentScan(basePackages = {
        "com.cashmama.market"
})
@ImportResource({
        "classpath*:app-redis.xml",
        "classpath*:amazon-s3-service.xml",
        "classpath:oss-service.xml",
        "classpath:message-context.xml",
        "classpath:dubbo-consumer.xml"
})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, XADataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
@ServletComponentScan(basePackageClasses = {com.fqgj.log.filter.TraceFilter.class})
//@NacosPropertySources({
//        @NacosPropertySource(dataId = "dc-api", autoRefreshed = true),
//        @NacosPropertySource(dataId = "fqgj-public", autoRefreshed = true, groupId = "cashmama"),
//        @NacosPropertySource(dataId = "system-public", autoRefreshed = true, groupId = "cashmama"),
//})

public class ApiApplication {
    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);
    }
}
